package y23.Dec;

import javax.swing.*;
import java.awt.*;
import java.util.Scanner;

public class Test13 {
    static int c;
    public static void main(String[] args) {
        new Drawing();
    }
    static class Drawing extends JFrame {
        public Drawing() {
            MyPanel mp = new MyPanel();
            this.add(mp);
            this.setSize(640,480);
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            this.setVisible(true);
        }
    }
    static class MyPanel extends JPanel {
        @Override
        public void paint(Graphics g) {
            Test13 test13 = new Test13();
            super.paint(g);
            char[] str = new char[5];
            int col = 100;
            int row = 50;
            int w = 0;
            T1 t = new T1();
            t.run();
            while(true){

                if (test13.c < 10){
                    g.drawString(String.valueOf(test13.c),col,row);
                }else {
                    g.drawString(".",col,row);
                }
                test13.c = 10;
                col += 10;
                if(col == 480){
                    col = 100;
                    row += 20;
                }
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    }
}

class T1 implements Runnable {

    @Override
    public void run() {
        Scanner scanner = new Scanner(System.in);
        Test13 test13 = new Test13();
        while (true){
            test13.c = scanner.nextInt();
        }
    }
}